package org.javastudy.springaction.ch4concert;


import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class Audience {
    @Before("execution(**ch4concert.Performance.perform(..))")
    public void silenceCellPhones(){
        System.out.println("Silencing cell phones");
    }

    @Before("execution(**ch4concert.Performance.perform(..))")
    public void takeSeats(){
        System.out.println("Taking seats");

    }
    @AfterReturning("execution(**ch4concert.Performance.perform(..))")
    public void applause(){
        System.out.println("CLAP CLAP CLAP");
    }

    @AfterThrowing("execution(**ch4concert.Performance.perform(..))")
    public void demandRefund(){
        System.out.println("Demanding a refund");
    }

}
